import request from '@/utils/request'

// 解绑
export function sendUnBind(data) {
  return request({
    url: '/gene/drugApiRole/un-bind', method: 'post', data: data
  })
}

// 获取角色下的所有tabs
export function getRoleTabs(drugApiId) {
  return request({
    url: '/gene/drugApiRole/getRoleTabs/' + drugApiId, method: 'get'
  })
}

// 绑定
export function sendBind(data) {
  return request({
    url: '/gene/drugApiRole/bind', method: 'post', data: data
  })
}

// 查询药物Api角色管理列表
export function listDrugApiRole(query) {
  return request({
    url: '/gene/drugApiRole/listDrugApiRole', method: 'get', params: query
  })
}

// 查妊娠用药角色绑定列表
export function selectPregnancyDrugApiList(query) {
  return request({
    url: '/gene/drugApiRole/selectPregnancyDrugApiList', method: 'get', params: query
  })
}

// 查询儿童用药角色绑定列表
export function selectChildrenDrugApiList(query) {
  return request({
    url: '/gene/drugApiRole/selectChildrenDrugApiList', method: 'get', params: query
  })
}
// 查询药物相互作用API角色列表
export function selectInteractionDrugApiList(query) {
  return request({
    url: '/gene/drugApiRole/selectInteractionDrugApiList', method: 'get', params: query
  })
}

/**
 * 批量绑定
 * @param data
 * @returns {*}
 */
export function sendBatchBind(data) {
  return request({
    url: '/gene/drugApiRole/bindBatch', method: 'post', data: data
  })
}

/**
 * 设置角色下模块的授权时间
 * @param data
 * @returns {*}
 */
export function setRoleApiTime(data) {
  return request({
    url: '/gene/drugApiRoleAuth/setRoleApiTime', method: 'post', data: data
  })
}

/**
 * 获取角色下模块的授权时间
 * @param data
 * @returns {*}
 */
export function getRoleApiTime(params) {
  return request({
    url: '/gene/drugApiRoleAuth/getRoleApiTime', method: 'get', params: params
  })
}
